﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MusicExplorer.Model
{
    public class QueryDefinition
    {
        private readonly QueryType m_queryType;
        private readonly EntityType m_entityType;

        public QueryDefinition(QueryType queryType, EntityType entityType)
        {
            m_queryType = queryType;
            m_entityType = entityType;
        }

        public QueryType QueryType { get { return m_queryType; } }
        public EntityType EntityType { get { return m_entityType; } }

        public override bool Equals(object obj)
        {
            var definition = (QueryDefinition)obj;
            return QueryType == definition.QueryType && EntityType == definition.EntityType;
        }

        public override int GetHashCode()
        {
            return m_queryType.GetHashCode() & m_entityType.GetHashCode();
        }
    }
}
